package com.mes.web.controller.cb;

import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @ClassName: DeploymentController
 * @Description: 部署流程
 * @Author cb
 * @Date 2018年3月28日14:43:11
 * @version 1.0
 */
@Controller
public class DeploymentController {


    @Resource
    private RepositoryService repositoryService;

    /**
     * 采购订单
     */
    @RequestMapping("/deploy1")
    public void deploy1() {

        Deployment deploy = repositoryService.createDeployment().addClasspathResource("flow/planMaterie.bpmn")
                .name("采购计划")
                .addClasspathResource("flow/planMaterie.png")
                .deploy();

        System.out.println("创建时间:"+deploy.getDeploymentTime());
        System.out.println("创建时间:"+deploy.getCategory());
        System.out.println("id:"+deploy.getId());
        System.out.println("部署的名称:"+deploy.getName());
    }
}
